home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / VBASIC / T2WIN-32.ZIP / _FILE.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-01-01  |  97.3 KB  |  2,004 lines

  1. VERSION 4.00
  2. Begin VB.Form frmFile 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "File"
  5.    ClientHeight    =   5160
  6.    ClientLeft      =   1485
  7.    ClientTop       =   2415
  8.    ClientWidth     =   7785
  9.    Height          =   5565
  10.    Left            =   1425
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   5160
  14.    ScaleWidth      =   7785
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2070
  17.    Width           =   7905
  18.    Begin VB.TextBox txt_Result 
  19.       BackColor       =   &H00C0C0C0&
  20.       BorderStyle     =   0  'None
  21.       Height          =   4425
  22.       Left            =   105
  23.       Locked          =   -1  'True
  24.       MultiLine       =   -1  'True
  25.       ScrollBars      =   2  'Vertical
  26.       TabIndex        =   0
  27.       Top             =   630
  28.       Width           =   7575
  29.    End
  30.    Begin Threed.SSPanel SSPanel1 
  31.       Align           =   1  'Align Top
  32.       Height          =   480
  33.       Left            =   0
  34.       TabIndex        =   1
  35.       Top             =   0
  36.       Width           =   7785
  37.       _Version        =   65536
  38.       _ExtentX        =   13732
  39.       _ExtentY        =   847
  40.       _StockProps     =   15
  41.       ForeColor       =   -2147483640
  42.       BackColor       =   12632256
  43.       Begin VB.ComboBox cmb_Function 
  44.          Height          =   315
  45.          Left            =   1365
  46.          TabIndex        =   2
  47.          Top             =   90
  48.          Width           =   5100
  49.       End
  50.       Begin Threed.SSCommand cmdNP 
  51.          Height          =   300
  52.          Index           =   1
  53.          Left            =   7455
  54.          TabIndex        =   6
  55.          Top             =   90
  56.          Width           =   255
  57.          _Version        =   65536
  58.          _ExtentX        =   450
  59.          _ExtentY        =   529
  60.          _StockProps     =   78
  61.          Caption         =   ">"
  62.          BevelWidth      =   1
  63.          Font3D          =   3
  64.          RoundedCorners  =   0   'False
  65.          Outline         =   0   'False
  66.       End
  67.       Begin Threed.SSCommand cmdNP 
  68.          Height          =   300
  69.          Index           =   0
  70.          Left            =   6615
  71.          TabIndex        =   5
  72.          Top             =   90
  73.          Width           =   255
  74.          _Version        =   65536
  75.          _ExtentX        =   450
  76.          _ExtentY        =   529
  77.          _StockProps     =   78
  78.          Caption         =   "<"
  79.          BevelWidth      =   1
  80.          Font3D          =   3
  81.          RoundedCorners  =   0   'False
  82.          Outline         =   0   'False
  83.       End
  84.       Begin VB.Label Label2 
  85.          Caption         =   "&Select a function"
  86.          Height          =   255
  87.          Left            =   90
  88.          TabIndex        =   4
  89.          Top             =   120
  90.          Width           =   1275
  91.       End
  92.       Begin Threed.SSCommand SSCommand1 
  93.          Default         =   -1  'True
  94.          Height          =   300
  95.          Left            =   6930
  96.          TabIndex        =   3
  97.          Top             =   90
  98.          Width           =   465
  99.          _Version        =   65536
  100.          _ExtentX        =   820
  101.          _ExtentY        =   529
  102.          _StockProps     =   78
  103.          Caption         =   "&Go"
  104.          BevelWidth      =   1
  105.          RoundedCorners  =   0   'False
  106.          Outline         =   0   'False
  107.       End
  108.    End
  109. Attribute VB_Name = "frmFile"
  110. Attribute VB_Creatable = False
  111. Attribute VB_Exposed = False
  112. Option Explicit
  113. Option Base 1
  114. Private Const Iteration = 10
  115. Dim IsLoaded         As Integer
  116. Dim TimerStartOk     As Integer
  117. Dim TimerCloseOk     As Integer
  118. Dim TimerHandle      As Integer
  119. Dim TimerValue       As Long
  120. Private Sub cmdNP_Click(Index As Integer)
  121.    Call sub_NextPrev(cmb_Function, Index)
  122. End Sub
  123. Private Sub cmb_Function_Click()
  124.    If (IsLoaded = False) Then Exit Sub
  125.    Call cDisableFI(mdiT2W.Picture1)
  126.    txt_Result = ""
  127.    DoEvents
  128.    Select Case cmb_Function.ListIndex
  129.       Case 0
  130.          Call TestAllSubDirectories
  131.       Case 1
  132.          Call TestChDir
  133.       Case 2
  134.          Call TestChDrive
  135.       Case 3
  136.          Call TestFileCompressExpandTab
  137.       Case 4
  138.          Call TestFileCopy
  139.       Case 5
  140.          Call TestFileMove
  141.       Case 6
  142.          Call TestFileFilter
  143.       Case 7
  144.          Call TestFileFilterNot
  145.       Case 8
  146.          Call TestFileSize
  147.       Case 9
  148.          Call TestFileLineCount
  149.       Case 10
  150.          Call TestFileUpperLower
  151.       Case 11
  152.          Call TestFileMerge
  153.       Case 12
  154.          Call TestFileSearchAndReplace
  155.       Case 13
  156.          Call TestFileSearch
  157.       Case 14
  158.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_SENSITIVE, False)
  159.       Case 15
  160.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_SENSITIVE, False)
  161.       Case 16
  162.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_INSENSITIVE, False)
  163.       Case 17
  164.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_INSENSITIVE, False)
  165.       Case 18
  166.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_SENSITIVE, True)
  167.       Case 19
  168.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_SENSITIVE, True)
  169.       Case 20
  170.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_INSENSITIVE, True)
  171.       Case 21
  172.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_INSENSITIVE, True)
  173.       Case 22
  174.          Call TestFileChangeChars
  175.       Case 23
  176.          Call TestIsFileX
  177.       Case 24
  178.          Call TestKillDir
  179.       Case 25
  180.          Call TestKillDirs
  181.       Case 26
  182.          Call TestGetDiskSpace
  183.       Case 27
  184.          Call TestGetDiskUsed
  185.       Case 28
  186.          Call TestGetDiskFree
  187.       Case 29
  188.          Call TestGetDiskClusterSize
  189.       Case 30
  190.          Call TestCountFiles
  191.       Case 31
  192.          Call TestCountDirectories
  193.       Case 32
  194.          Call TestRcsCountFileDir
  195.       Case 33
  196.          Call TestFilesSizeX
  197.       Case 34
  198.          Call TestRcsFilesSizeX
  199.       Case 35
  200.          Call TestTruncatePath
  201.       Case 36
  202.          Call TestMakeSplitPath
  203.       Case 37
  204.          Call TestFullPath
  205.       Case 38
  206.          Call TestRenameFile
  207.       Case 39
  208.          Call TestUniqueFileName
  209.       Case 40
  210.          Call TestFilesInDirectory
  211.       Case 41
  212.          Call TestSubDirectory
  213.       Case 42
  214.          Call TestFileGetAttribute
  215.       Case 43
  216.          Call TestFileSetAttribute
  217.       Case 44
  218.          Call TestFileSetAllAttributes
  219.       Case 45
  220.          Call TestFileResetAllAttributes
  221.       Case 46
  222.          Call TestFileCompareX
  223.       Case 47
  224.          Call TestFileDrive
  225.       Case 48
  226.          Call TestFilesInDirOnDisk
  227.       Case 49
  228.          Call TestFileDateTime
  229.       Case 50
  230.          Call TestFileStatistics
  231.       Case 51
  232.          Call TestGetDriveType
  233.       Case 52
  234.          Call TestPBFileCopy
  235.       Case 53
  236.          Call TestDBFileCopy
  237.       Case 54
  238.          Call TestFileUUCP
  239.       Case 55
  240.          Call TestOpenFiles(ENUMERATE_ALL_OPEN_FILES)
  241.       Case 56
  242.          Call TestOpenFiles(ENUMERATE_ONLY_OPEN_UNMOVABLE_FILES)
  243.       Case 57
  244.          Call TestSplitFile
  245.       Case 58
  246.          Call TestCutFile
  247.       Case 59
  248.          Call TestGetFileDateTime
  249.       Case 60
  250.          Call TestSetFileDateTime
  251.    End Select
  252.    DoEvents
  253.    Call cEnableFI(mdiT2W.Picture1)
  254. End Sub
  255. Private Sub Form_Activate()
  256.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  257. End Sub
  258. Private Sub Form_Load()
  259.    IsLoaded = False
  260.    Show
  261.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_file.t2w")
  262.    IsLoaded = True
  263. End Sub
  264. Private Sub SSCommand1_Click()
  265.    Call cmb_Function_Click
  266. End Sub
  267. Private Sub TestAllSubDirectories()
  268.    Dim intResult        As Integer
  269.    Dim strResult        As String
  270.    Dim strDisplay       As String
  271.    Dim i                As Long
  272.    strResult = ""
  273.    strDisplay = ""
  274.    i = -1
  275.    TimerHandle = cTimerOpen()
  276.    TimerStartOk = cTimerStart(TimerHandle)
  277.    strResult = cAllSubDirectories("C:", i)
  278.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  279.    TimerCloseOk = cTimerClose(TimerHandle)
  280.    strResult = cStringSAR(strResult, vbCr, vbCrLf, False)
  281.    strDisplay = "Directories founden on drive C are " & i & vbCrLf & vbCrLf & strResult
  282.    txt_Result = strDisplay
  283. End Sub
  284. Private Sub TestChDir()
  285.    Dim intResult        As Integer
  286.    Dim strResult        As String
  287.    Dim strDisplay       As String
  288.    Dim i                As Integer
  289.    strResult = ""
  290.    strDisplay = ""
  291.    For i = 1 To 26
  292.       intResult = cChDir(Chr$(64 + i) & ":\")
  293.       If (intResult = True) Then
  294.          strDisplay = strDisplay & "ChDir to \ on '" & Chr$(64 + i) & ":' is " & IIf(intResult = True, "succesfull", "not successfull") & vbCrLf
  295.       End If
  296.    Next i
  297.      
  298.    txt_Result = strDisplay
  299.    'time the function
  300.    TimerHandle = cTimerOpen()
  301.    TimerStartOk = cTimerStart(TimerHandle)
  302.    For i = 1 To Iteration
  303.       intResult = cChDir("C:\")
  304.    Next i
  305.    intResult = cChDir(T2WDirTest)
  306.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  307.    TimerCloseOk = cTimerClose(TimerHandle)
  308. End Sub
  309. Private Sub TestChDrive()
  310.    Dim intResult        As Integer
  311.    Dim strResult        As String
  312.    Dim strDisplay       As String
  313.    Dim i                As Integer
  314.    strResult = ""
  315.    strDisplay = ""
  316.    For i = 1 To 26
  317.       intResult = cChDrive(Chr$(64 + i))
  318.       If (intResult = True) Then
  319.          strDisplay = strDisplay & "ChDrive on '" & Chr$(64 + i) & ":' is " & IIf(intResult = True, "succesfull", "not successfull") & vbCrLf
  320.       End If
  321.    Next i
  322.    txt_Result = strDisplay
  323.    'time the function
  324.    TimerHandle = cTimerOpen()
  325.    TimerStartOk = cTimerStart(TimerHandle)
  326.    For i = 1 To Iteration
  327.       intResult = cChDrive("C")
  328.    Next i
  329.    intResult = cChDrive(T2WDirTest)
  330.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  331.    TimerCloseOk = cTimerClose(TimerHandle)
  332. End Sub
  333. Private Sub TestFileCompressExpandTab()
  334.    Dim lngResult        As Long
  335.    Dim strResult        As String
  336.    Dim strDisplay       As String
  337.    Dim i                As Long
  338.    Dim File1            As String
  339.    Dim File2            As String
  340.    Dim File3            As String
  341.    strResult = ""
  342.    strDisplay = ""
  343.    File1 = T2WFileTest
  344.    File2 = "autoexec.tabcompressed"
  345.    File3 = "autoexec.tabexpanded"
  346.    For i = 1 To 4
  347.       strDisplay = strDisplay & "File CompressTab (" & i & " spaces = 1 tab) " & File1 & " to " & File2 & " is " & cFileCompressTab(File1, File2, i) & vbCrLf
  348.       strDisplay = strDisplay & "File ExpandTab (" & i & " spaces = 1 tab) " & File2 & " to " & File3 & " is " & cFileExpandTab(File2, File3, i) & vbCrLf
  349.       strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  350.    Next i
  351.    txt_Result = strDisplay
  352.    'time the function
  353.    TimerHandle = cTimerOpen()
  354.    TimerStartOk = cTimerStart(TimerHandle)
  355.    For i = 1 To Iteration
  356.       lngResult = cFileExpandTab(File1, File2, 3)
  357.    Next i
  358.    lngResult = cFileCompressTab(File2, File3, 3)
  359.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  360.    TimerCloseOk = cTimerClose(TimerHandle)
  361. End Sub
  362. Private Sub TestFileCopy()
  363.    Dim lngResult        As Long
  364.    Dim strResult        As String
  365.    Dim strDisplay       As String
  366.    Dim i                As Long
  367.    Dim File1            As String
  368.    Dim File2            As String
  369.    strResult = ""
  370.    strDisplay = ""
  371.    File1 = T2WFileTest
  372.    File2 = "autoexec.copy"
  373.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  374.    strDisplay = strDisplay & "File Copy2 '" & File1 & "' to '" & File2 & "' is " & cFileCopy2(File1, File2) & vbCrLf & vbCrLf
  375.    txt_Result = strDisplay
  376.    'time the function
  377.    TimerHandle = cTimerOpen()
  378.    TimerStartOk = cTimerStart(TimerHandle)
  379.    For i = 1 To Iteration
  380.       lngResult = cFileCopy(File1, File2)
  381.    Next i
  382.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  383.    TimerCloseOk = cTimerClose(TimerHandle)
  384. End Sub
  385. Private Sub TestFileMove()
  386.    Dim lngResult        As Long
  387.    Dim strResult        As String
  388.    Dim strDisplay       As String
  389.    Dim i                As Long
  390.    Dim File1            As String
  391.    Dim File2            As String
  392.    strResult = ""
  393.    strDisplay = ""
  394.    File1 = T2WFileTest
  395.    File2 = "c:\win95\autoexec.bat"
  396.    strDisplay = strDisplay & "File Move '" & File1 & "' to '" & File2 & "' is " & cFileMove(File1, File2) & vbCrLf & vbCrLf
  397.    txt_Result = strDisplay
  398.    'time the function
  399.    TimerHandle = cTimerOpen()
  400.    TimerStartOk = cTimerStart(TimerHandle)
  401.    For i = 1 To Iteration
  402.       lngResult = cFileMove(File1, File2)
  403.    Next i
  404.    lngResult = cFileCopy(File2, File1)
  405.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  406.    TimerCloseOk = cTimerClose(TimerHandle)
  407. End Sub
  408. Private Sub TestFileFilter()
  409.    Dim lngResult        As Long
  410.    Dim strResult        As String
  411.    Dim strDisplay       As String
  412.    Dim i                As Long
  413.    Dim File1            As String
  414.    Dim File2            As String
  415.    Dim Filter           As String
  416.    strResult = ""
  417.    strDisplay = ""
  418.    File1 = T2WFileTest
  419.    File2 = "autoexec.filter"
  420.    Filter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  421.    Filter = Filter + LCase$(Filter)
  422.    strDisplay = strDisplay & "File Filter (A-Z, a-z) '" & File1 & "' to '" & File2 & "' is " & cFileFilter(File1, File2, Filter) & vbCrLf & vbCrLf
  423.    txt_Result = strDisplay
  424.    'time the function
  425.    TimerHandle = cTimerOpen()
  426.    TimerStartOk = cTimerStart(TimerHandle)
  427.    For i = 1 To Iteration
  428.       lngResult = cFileFilter(File1, File2, Filter)
  429.    Next i
  430.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  431.    TimerCloseOk = cTimerClose(TimerHandle)
  432. End Sub
  433. Private Sub TestFileFilterNot()
  434.    Dim lngResult        As Long
  435.    Dim strResult        As String
  436.    Dim strDisplay       As String
  437.    Dim i                As Long
  438.    Dim File1            As String
  439.    Dim File2            As String
  440.    Dim Filter           As String
  441.    strResult = ""
  442.    strDisplay = ""
  443.    File1 = T2WFileTest
  444.    File2 = "autoexec.filternot"
  445.    Filter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  446.    Filter = Filter + LCase$(Filter)
  447.    strDisplay = strDisplay & "File Filter Not (A-Z, a-z) '" & File1 & "' to '" & File2 & "' is " & cFileFilter(File1, File2, Filter) & vbCrLf & vbCrLf
  448.    txt_Result = strDisplay
  449.    'time the function
  450.    TimerHandle = cTimerOpen()
  451.    TimerStartOk = cTimerStart(TimerHandle)
  452.    For i = 1 To Iteration
  453.       lngResult = cFileFilterNot(File1, File2, Filter)
  454.    Next i
  455.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  456.    TimerCloseOk = cTimerClose(TimerHandle)
  457. End Sub
  458. Private Sub TestFileSize()
  459.    Dim lngResult        As Long
  460.    Dim strResult        As String
  461.    Dim strDisplay       As String
  462.    Dim i                As Long
  463.    Dim File1            As String
  464.    Dim File2            As String
  465.    strResult = ""
  466.    strDisplay = ""
  467.    File1 = T2WFileTest
  468.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  469.    File1 = "c:\autoexec.bat"
  470.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  471.    File1 = "c:\config.sys"
  472.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  473.    File1 = "c:\test.tst"
  474.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  475.    File1 = "c:\command.com"
  476.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  477.    txt_Result = strDisplay
  478.    'time the function
  479.    TimerHandle = cTimerOpen()
  480.    TimerStartOk = cTimerStart(TimerHandle)
  481.    For i = 1 To Iteration
  482.       lngResult = cFileSize(File1)
  483.    Next i
  484.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  485.    TimerCloseOk = cTimerClose(TimerHandle)
  486. End Sub
  487. Private Sub TestFileLineCount()
  488.    Dim lngResult        As Long
  489.    Dim strResult        As String
  490.    Dim strDisplay       As String
  491.    Dim i                As Long
  492.    Dim File1            As String
  493.    Dim File2            As String
  494.    strResult = ""
  495.    strDisplay = ""
  496.    File1 = T2WFileTest
  497.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  498.    File1 = "c:\autoexec.bat"
  499.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  500.    File1 = "c:\config.sys"
  501.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  502.    File1 = "c:\test.tst"
  503.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  504.    File1 = "c:\command.com"
  505.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  506.    txt_Result = strDisplay
  507.    'time the function
  508.    TimerHandle = cTimerOpen()
  509.    TimerStartOk = cTimerStart(TimerHandle)
  510.    For i = 1 To Iteration
  511.       lngResult = cFileLineCount(File1)
  512.    Next i
  513.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  514.    TimerCloseOk = cTimerClose(TimerHandle)
  515. End Sub
  516. Public Sub TestFileUpperLower()
  517.    Dim lngResult        As Long
  518.    Dim strResult        As String
  519.    Dim strDisplay       As String
  520.    Dim i                As Long
  521.    Dim File1            As String
  522.    Dim File2            As String
  523.    Dim File3            As String
  524.    strResult = ""
  525.    strDisplay = ""
  526.    File1 = T2WFileTest
  527.    File2 = "autoexec.toupper"
  528.    File3 = "autoexec.tolower"
  529.    strDisplay = strDisplay & "File to upper '" & File1 & "' to '" & File2 & "' is " & cFileToUpper(File1, File2) & vbCrLf & vbCrLf
  530.    strDisplay = strDisplay & "File to lower '" & File1 & "' to '" & File3 & "' is " & cFileToLower(File1, File3) & vbCrLf & vbCrLf
  531.    txt_Result = strDisplay
  532.    'time the function
  533.    TimerHandle = cTimerOpen()
  534.    TimerStartOk = cTimerStart(TimerHandle)
  535.    For i = 1 To Iteration
  536.       lngResult = cFileToUpper(File1, File2)
  537.    Next i
  538.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  539.    TimerCloseOk = cTimerClose(TimerHandle)
  540. End Sub
  541. Private Sub TestFileMerge()
  542.    Dim lngResult        As Long
  543.    Dim strResult        As String
  544.    Dim strDisplay       As String
  545.    Dim i                As Long
  546.    Dim File1            As String
  547.    Dim File2            As String
  548.    Dim File3            As String
  549.    strResult = ""
  550.    strDisplay = ""
  551.    File1 = T2WFileTest
  552.    File2 = "c:\config.sys"
  553.    File3 = "autoexec.merged"
  554.    strDisplay = strDisplay & "File Merge '" & File1 & "' and '" & File2 & "' to '" & File3 & "' is " & cFileMerge(File1, File2, File3) & vbCrLf & vbCrLf
  555.    txt_Result = strDisplay
  556.    'time the function
  557.    TimerHandle = cTimerOpen()
  558.    TimerStartOk = cTimerStart(TimerHandle)
  559.    For i = 1 To Iteration
  560.       lngResult = cFileMerge(File1, File2, File3)
  561.    Next i
  562.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  563.    TimerCloseOk = cTimerClose(TimerHandle)
  564. End Sub
  565. Private Sub TestFileSearchAndReplace()
  566.    Dim lngResult        As Long
  567.    Dim strResult        As String
  568.    Dim strDisplay       As String
  569.    Dim i                As Long
  570.    Dim File1            As String
  571.    Dim File2            As String
  572.    Dim Search           As String
  573.    Dim Replace          As String
  574.    strResult = ""
  575.    strDisplay = ""
  576.    File1 = T2WFileTest
  577.    File2 = "autoexec.searchandreplace"
  578.    Search = "rem SET "
  579.    Replace = "REM set "
  580.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  581.    strDisplay = strDisplay & "File Search-Replace (sensitive) : '" & Search & "' -> '" & Replace & "' in '" & File2 & "' is " & cFileSearchAndReplace(File2, Search, Replace, "tmp.tmp", True) & vbCrLf & vbCrLf
  582.    strDisplay = strDisplay & "File Search-Replace (sensitive) : '" & Replace & "' -> '" & Search & "' in '" & File2 & "' is " & cFileSearchAndReplace(File2, Replace, Search, "tmp.tmp", True) & vbCrLf & vbCrLf
  583.    strDisplay = strDisplay & "Compare file contents (insensitive) '" & File2 & "' with '" & File1 & "' is " & IIf(cCmpFileContents(File2, File1, False) = True, "same", "not same") & vbCrLf & vbCrLf
  584.    txt_Result = strDisplay
  585.    'time the function
  586.    TimerHandle = cTimerOpen()
  587.    TimerStartOk = cTimerStart(TimerHandle)
  588.    For i = 1 To Iteration
  589.       If ((i Mod 2) = 1) Then
  590.          lngResult = cFileSearchAndReplace(File1, Search, Replace, "", True)
  591.       Else
  592.          lngResult = cFileSearchAndReplace(File1, Search, Replace, "", True)
  593.       End If
  594.    Next i
  595.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  596.    TimerCloseOk = cTimerClose(TimerHandle)
  597. End Sub
  598. Private Sub TestFileSearch()
  599.    Dim lngResult        As Long
  600.    Dim strResult        As String
  601.    Dim strDisplay       As String
  602.    Dim i                As Long
  603.    Dim File1            As String
  604.    Dim Search1          As String
  605.    Dim Search2          As String
  606.    strResult = ""
  607.    strDisplay = ""
  608.    File1 = T2WFileTest
  609.    Search1 = "re"
  610.    Search2 = "SET"
  611.    strDisplay = strDisplay & "File Search (insensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearch(File1, Search1, False) & vbCrLf & vbCrLf
  612.    strDisplay = strDisplay & "File Search and Count (insensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search1, False) & vbCrLf & vbCrLf
  613.    strDisplay = strDisplay & "File Search (insensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearch(File1, Search2, False) & vbCrLf & vbCrLf
  614.    strDisplay = strDisplay & "File Search and Count (insensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search2, False) & vbCrLf & vbCrLf
  615.    strDisplay = strDisplay & "File Search (sensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearch(File1, Search1, True) & vbCrLf & vbCrLf
  616.    strDisplay = strDisplay & "File Search and Count (sensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search1, True) & vbCrLf & vbCrLf
  617.    strDisplay = strDisplay & "File Search (sensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearch(File1, Search2, True) & vbCrLf & vbCrLf
  618.    strDisplay = strDisplay & "File Search and Count (sensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search2, True) & vbCrLf & vbCrLf
  619.    txt_Result = strDisplay
  620.    'time the function
  621.    TimerHandle = cTimerOpen()
  622.    TimerStartOk = cTimerStart(TimerHandle)
  623.    For i = 1 To Iteration
  624.       If ((i Mod 2) = 1) Then
  625.          lngResult = cFileSearch(File1, Search1, False)
  626.       Else
  627.          lngResult = cFileSearchCount(File1, Search2, False)
  628.       End If
  629.    Next i
  630.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  631.    TimerCloseOk = cTimerClose(TimerHandle)
  632. End Sub
  633. Private Sub TestFileSort(intSortMethod As Integer, intVarFix As Integer)
  634.    Dim lngResult        As Long
  635.    Dim strResult        As String
  636.    Dim strDisplay       As String
  637.    Dim i                As Long
  638.    Dim n                As Long
  639.    Dim File1            As String
  640.    Dim File2            As String
  641.    strResult = ""
  642.    strDisplay = ""
  643.    File1 = T2WFileTest
  644.    File2 = "autoexec.sort" & intSortMethod & Abs(intVarFix)
  645.    strDisplay = "The 7 first lines in '" & File1 & "' before sorting are " & vbCrLf & vbCrLf
  646.    Close #1
  647.    Open File1 For Input Shared As #1
  648.    For i = 1 To 7
  649.       Line Input #1, strResult
  650.       strDisplay = strDisplay + strResult + vbCrLf
  651.    Next i
  652.    Close #1
  653.    If (intVarFix = False) Then
  654.       lngResult = cFileSort(File1, File2, intSortMethod, -1, -1, -1, n)
  655.    Else
  656.       lngResult = cFileSort(File1, File2, intSortMethod, 7, 0, 7, n)
  657.    End If
  658.    strDisplay = strDisplay + vbCrLf
  659.    strDisplay = strDisplay + "The 7 first lines in '" & File2 & "' after sorting are " & vbCrLf & vbCrLf
  660.    Close #1
  661.    Open File2 For Input Shared As #1
  662.    For i = 1 To 7
  663.       Line Input #1, strResult
  664.       strDisplay = strDisplay + strResult + vbCrLf
  665.    Next i
  666.    Close #1
  667.    strDisplay = strDisplay + vbCrLf
  668.    Select Case intSortMethod
  669.       Case (SORT_ASCENDING + SORT_CASE_SENSITIVE):
  670.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in ASC and CS is '" & lngResult & "' and records are '" & n & "'"
  671.       Case (SORT_DESCENDING + SORT_CASE_SENSITIVE):
  672.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in DSC and CS is '" & lngResult & "' and records are '" & n & "'"
  673.       Case (SORT_ASCENDING + SORT_CASE_INSENSITIVE):
  674.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in ASC and NS is '" & lngResult & "' and records are '" & n & "'"
  675.       Case (SORT_DESCENDING + SORT_CASE_INSENSITIVE):
  676.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in DSC and NS is '" & lngResult & "' and records are '" & n & "'"
  677.    End Select
  678.    txt_Result = strDisplay
  679.    'time the function
  680.    TimerHandle = cTimerOpen()
  681.    TimerStartOk = cTimerStart(TimerHandle)
  682.    For i = 1 To Iteration
  683.       lngResult = cFileSort(File1, File2, intSortMethod, -1, -1, -1, n)
  684.    Next i
  685.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  686.    TimerCloseOk = cTimerClose(TimerHandle)
  687. End Sub
  688. Private Sub TestFileChangeChars()
  689.    Dim lngResult        As Long
  690.    Dim strResult        As String
  691.    Dim strDisplay       As String
  692.    Dim i                As Long
  693.    Dim File1            As String
  694.    Dim File2            As String
  695.    Dim Change1          As String
  696.    Dim Change2          As String
  697.    strResult = ""
  698.    strDisplay = ""
  699.    File1 = T2WFileTest
  700.    File2 = "autoexec.changechars"
  701.    Change1 = "REM"
  702.    Change2 = "mer"
  703.    txt_Result = strDisplay
  704.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  705.    strDisplay = strDisplay & "The 7 first lines in '" & File2 & "' before change are " & vbCrLf & vbCrLf
  706.    Close #1
  707.    Open File2 For Input Shared As #1
  708.    For i = 1 To 7
  709.       Line Input #1, strResult
  710.       strDisplay = strDisplay + strResult + vbCrLf
  711.    Next i
  712.    Close #1
  713.    strDisplay = strDisplay + vbCrLf
  714.    strDisplay = strDisplay & "File Change Chars : '" & Change1 & "' -> '" & Change2 & "' in '" & File2 & "' is " & cFileChangeChars(File2, Change1, Change2, "file1.file1") & vbCrLf & vbCrLf
  715.    strDisplay = strDisplay & "The 7 first lines in '" & File2 & "' after change are " & vbCrLf & vbCrLf
  716.    Close #1
  717.    Open File2 For Input Shared As #1
  718.    For i = 1 To 7
  719.       Line Input #1, strResult
  720.       strDisplay = strDisplay + strResult + vbCrLf
  721.    Next i
  722.    Close #1
  723.    txt_Result = strDisplay
  724.    'time the function
  725.    TimerHandle = cTimerOpen()
  726.    TimerStartOk = cTimerStart(TimerHandle)
  727.    For i = 1 To Iteration
  728.       If ((i Mod 2) = 1) Then
  729.          lngResult = cFileChangeChars(File2, Change1, Change2, "")
  730.       Else
  731.          lngResult = cFileChangeChars(File2, Change2, Change1, "")
  732.       End If
  733.    Next i
  734.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  735.    TimerCloseOk = cTimerClose(TimerHandle)
  736. End Sub
  737. Private Sub TestIsFileX()
  738.    Dim intResult        As Integer
  739.    Dim strResult        As String
  740.    Dim strDisplay       As String
  741.    Dim i                As Integer
  742.    Dim File1            As String
  743.    strResult = ""
  744.    strDisplay = ""
  745.    File1 = T2WFileTest
  746.    strDisplay = strDisplay & "File '" & File1 & "' is " & vbCrLf & vbCrLf
  747.    strDisplay = strDisplay & IIf(cIsFilenameValid(File1), " a good filename", " is not a good filename") & vbCrLf
  748.    strDisplay = strDisplay & IIf(cIsFileArchive(File1), " archive", " not archive") & vbCrLf
  749.    strDisplay = strDisplay & IIf(cIsFileHidden(File1), " hidden", " not hidden") & vbCrLf
  750.    strDisplay = strDisplay & IIf(cIsFileNormal(File1), " normal", " not normal") & vbCrLf
  751.    strDisplay = strDisplay & IIf(cIsFileReadOnly(File1), " read-only", " not read-only") & vbCrLf
  752.    strDisplay = strDisplay & IIf(cIsFileSubDir(File1), " sub-directory", " not sub-directory") & vbCrLf
  753.    strDisplay = strDisplay & IIf(cIsFileSystem(File1), " system", " not system") & vbCrLf
  754.    strDisplay = strDisplay & IIf(cIsFileCompressed(File1), " compressed", " not compressed") & vbCrLf & vbCrLf
  755.      
  756.    File1 = cGetWindowsDirectory() & "\user.dat"
  757.    strDisplay = strDisplay & vbCrLf
  758.    strDisplay = strDisplay & "File '" & File1 & "' is " & vbCrLf & vbCrLf
  759.    strDisplay = strDisplay & IIf(cIsFilenameValid(File1), " a good filename", " is not a good filename") & vbCrLf
  760.    strDisplay = strDisplay & IIf(cIsFileArchive(File1), " archive", " not archive") & vbCrLf
  761.    strDisplay = strDisplay & IIf(cIsFileHidden(File1), " hidden", " not hidden") & vbCrLf
  762.    strDisplay = strDisplay & IIf(cIsFileNormal(File1), " normal", " not normal") & vbCrLf
  763.    strDisplay = strDisplay & IIf(cIsFileReadOnly(File1), " read-only", " not read-only") & vbCrLf
  764.    strDisplay = strDisplay & IIf(cIsFileSubDir(File1), " sub-directory", " not sub-directory") & vbCrLf
  765.    strDisplay = strDisplay & IIf(cIsFileSystem(File1), " system", " not system") & vbCrLf
  766.    strDisplay = strDisplay & IIf(cIsFileCompressed(File1), " compressed", " not compressed") & vbCrLf & vbCrLf
  767.      
  768.    txt_Result = strDisplay
  769.    'time the function
  770.    TimerHandle = cTimerOpen()
  771.    TimerStartOk = cTimerStart(TimerHandle)
  772.    For i = 1 To Iteration
  773.       intResult = cIsFilenameValid(File1)
  774.    Next i
  775.    intResult = cChDir(T2WDirTest)
  776.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  777.    TimerCloseOk = cTimerClose(TimerHandle)
  778. End Sub
  779. Private Sub TestKillDir()
  780.    Dim intResult        As Integer
  781.    Dim strResult        As String
  782.    Dim strDisplay       As String
  783.    Dim i                As Integer
  784.    Dim File1            As String
  785.    strResult = ""
  786.    strDisplay = ""
  787.    File1 = "c:\this is a test for KillDir"
  788.    intResult = cMakeDir(File1)
  789.    strDisplay = strDisplay & "Directory '" & File1 & "' is created" & vbCrLf & vbCrLf
  790.    strDisplay = strDisplay & "Directory '" & File1 & "' is " & IIf(cKillDir(File1) = True, "deleted", "not deleted") & vbCrLf & vbCrLf
  791.      
  792.    txt_Result = strDisplay
  793.    'time the function
  794.    TimerHandle = cTimerOpen()
  795.    TimerStartOk = cTimerStart(TimerHandle)
  796.    For i = 1 To Iteration
  797.       intResult = cKillDir(File1)
  798.    Next i
  799.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  800.    TimerCloseOk = cTimerClose(TimerHandle)
  801. End Sub
  802. Private Sub TestKillDirs()
  803.    Dim intResult        As Integer
  804.    Dim strResult        As String
  805.    Dim strDisplay       As String
  806.    Dim i                As Integer
  807.    Dim File1            As String
  808.    strResult = ""
  809.    strDisplay = ""
  810.    File1 = "c:\this1\this2\this3\this4"
  811.    intResult = cMakeMultipleDir(File1)
  812.    strDisplay = strDisplay & "Directories '" & File1 & "' are created" & vbCrLf & vbCrLf
  813.    strDisplay = strDisplay & "Directories '" & File1 & "' are " & IIf(cKillDirs("c:\this1", True) > 0, "deleted", "not deleted") & vbCrLf & vbCrLf
  814.      
  815.    txt_Result = strDisplay
  816.    'time the function
  817.    TimerHandle = cTimerOpen()
  818.    TimerStartOk = cTimerStart(TimerHandle)
  819.    For i = 1 To Iteration
  820.       intResult = cKillDirs(File1, True)
  821.    Next i
  822.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  823.    TimerCloseOk = cTimerClose(TimerHandle)
  824. End Sub
  825. Private Sub TestGetDiskSpace()
  826.    Dim lngResult        As Double
  827.    Dim strResult        As String
  828.    Dim strDisplay       As String
  829.    Dim i                As Integer
  830.    strResult = ""
  831.    strDisplay = ""
  832.    For i = 1 To 26
  833.       lngResult = cGetDiskSpace(Chr$(64 + i))
  834.       If (lngResult <> True) Then
  835.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  836.       End If
  837.    Next i
  838.      
  839.    txt_Result = strDisplay
  840.    'time the function
  841.    TimerHandle = cTimerOpen()
  842.    TimerStartOk = cTimerStart(TimerHandle)
  843.    For i = 1 To Iteration
  844.       lngResult = cGetDiskSpace("C")
  845.    Next i
  846.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  847.    TimerCloseOk = cTimerClose(TimerHandle)
  848. End Sub
  849. Private Sub TestGetDiskUsed()
  850.    Dim lngResult        As Double
  851.    Dim strResult        As String
  852.    Dim strDisplay       As String
  853.    Dim i                As Integer
  854.    strResult = ""
  855.    strDisplay = ""
  856.    For i = 1 To 26
  857.       lngResult = cGetDiskUsed(Chr$(64 + i))
  858.       If (lngResult <> True) Then
  859.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  860.       End If
  861.    Next i
  862.      
  863.    txt_Result = strDisplay
  864.    'time the function
  865.    TimerHandle = cTimerOpen()
  866.    TimerStartOk = cTimerStart(TimerHandle)
  867.    For i = 1 To Iteration
  868.       lngResult = cGetDiskUsed("C")
  869.    Next i
  870.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  871.    TimerCloseOk = cTimerClose(TimerHandle)
  872. End Sub
  873. Private Sub TestGetDiskFree()
  874.    Dim lngResult        As Double
  875.    Dim strResult        As String
  876.    Dim strDisplay       As String
  877.    Dim i                As Integer
  878.    strResult = ""
  879.    strDisplay = ""
  880.    For i = 1 To 26
  881.       lngResult = cGetDiskFree(Chr$(64 + i))
  882.       If (lngResult <> True) Then
  883.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  884.       End If
  885.    Next i
  886.      
  887.    txt_Result = strDisplay
  888.    'time the function
  889.    TimerHandle = cTimerOpen()
  890.    TimerStartOk = cTimerStart(TimerHandle)
  891.    For i = 1 To Iteration
  892.       lngResult = cGetDiskFree("C")
  893.    Next i
  894.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  895.    TimerCloseOk = cTimerClose(TimerHandle)
  896. End Sub
  897. Private Sub TestGetDiskClusterSize()
  898.    Dim lngResult        As Double
  899.    Dim strResult        As String
  900.    Dim strDisplay       As String
  901.    Dim i                As Integer
  902.    strResult = ""
  903.    strDisplay = ""
  904.    For i = 1 To 26
  905.       lngResult = cGetDiskClusterSize(Chr$(64 + i))
  906.       If (lngResult <> True) Then
  907.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  908.       End If
  909.    Next i
  910.      
  911.    txt_Result = strDisplay
  912.    'time the function
  913.    TimerHandle = cTimerOpen()
  914.    TimerStartOk = cTimerStart(TimerHandle)
  915.    For i = 1 To Iteration
  916.       lngResult = cGetDiskClusterSize("C")
  917.    Next i
  918.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  919.    TimerCloseOk = cTimerClose(TimerHandle)
  920. End Sub
  921. Private Sub TestRcsCountFileDir()
  922.    Dim lngResult        As Long
  923.    Dim strResult        As String
  924.    Dim strDisplay       As String
  925.    Dim i                As Integer
  926.    strResult = ""
  927.    strDisplay = ""
  928.    strDisplay = strDisplay & "Total directories in C: is " & cRcsCountFileDir(False, "C:", "", True) & vbCrLf
  929.    strDisplay = strDisplay & "Total directories in D: is " & cRcsCountFileDir(False, "D:", "", True) & vbCrLf
  930.    strDisplay = strDisplay & vbCrLf
  931.    strDisplay = strDisplay & "Total files in C: is " & cRcsCountFileDir(True, "C:", "", True) & vbCrLf
  932.    strDisplay = strDisplay & "Total files in D: is " & cRcsCountFileDir(True, "D:", "", True) & vbCrLf
  933.    strDisplay = strDisplay & vbCrLf
  934.    strDisplay = strDisplay & "Total files in C:*.DAT is " & cRcsCountFileDir(True, "C:", "*.DAT", True) & vbCrLf
  935.    strDisplay = strDisplay & "Total files in D:*.DAT is " & cRcsCountFileDir(True, "D:", "*.DAT", True) & vbCrLf
  936.    strDisplay = strDisplay & vbCrLf
  937.    strDisplay = strDisplay & "Total directories in C:\ is " & cRcsCountFileDir(False, "C:", "", False) & vbCrLf
  938.    strDisplay = strDisplay & "Total directories in D:\ is " & cRcsCountFileDir(False, "D:", "", False) & vbCrLf
  939.    strDisplay = strDisplay & vbCrLf
  940.    strDisplay = strDisplay & "Total files in C:\ is " & cRcsCountFileDir(True, "C:", "", False) & vbCrLf
  941.    strDisplay = strDisplay & "Total files in D:\ is " & cRcsCountFileDir(True, "D:", "", False) & vbCrLf
  942.    strDisplay = strDisplay & vbCrLf
  943.    strDisplay = strDisplay & "Total files in C:\*.DAT is " & cRcsCountFileDir(True, "C:", "*.DAT", False) & vbCrLf
  944.    strDisplay = strDisplay & "Total files in D:\*.DAT is " & cRcsCountFileDir(True, "D:", "*.DAT", False) & vbCrLf
  945.    txt_Result = strDisplay
  946.    'time the function
  947.    TimerHandle = cTimerOpen()
  948.    TimerStartOk = cTimerStart(TimerHandle)
  949.    For i = 1 To Iteration
  950.       lngResult = cRcsCountFileDir(False, "C:", "", False)
  951.    Next i
  952.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  953.    TimerCloseOk = cTimerClose(TimerHandle)
  954. End Sub
  955. Private Sub TestCountFiles()
  956.    Dim lngResult        As Long
  957.    Dim strResult        As String
  958.    Dim strDisplay       As String
  959.    Dim i                As Integer
  960.    strResult = ""
  961.    strDisplay = ""
  962.    strDisplay = strDisplay & "Number of files in C:\ is " & cCountFiles("C:\*.*") & vbCrLf & vbCrLf
  963.    strDisplay = strDisplay & "Number of files in D:\ is " & cCountFiles("D:\*.*") & vbCrLf & vbCrLf
  964.    strDisplay = strDisplay & "Number of files in E:\ is " & cCountFiles("E:\*.*") & vbCrLf & vbCrLf
  965.    txt_Result = strDisplay
  966.    'time the function
  967.    TimerHandle = cTimerOpen()
  968.    TimerStartOk = cTimerStart(TimerHandle)
  969.    For i = 1 To Iteration
  970.       lngResult = cCountFiles("C:\*.*")
  971.    Next i
  972.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  973.    TimerCloseOk = cTimerClose(TimerHandle)
  974. End Sub
  975. Private Sub TestCountDirectories()
  976.    Dim lngResult        As Long
  977.    Dim strResult        As String
  978.    Dim strDisplay       As String
  979.    Dim i                As Integer
  980.    strResult = ""
  981.    strDisplay = ""
  982.    strDisplay = strDisplay & "Number of directories in C:\ is " & cCountDirectories("C:\*.*") & vbCrLf & vbCrLf
  983.    strDisplay = strDisplay & "Number of directories in D:\ is " & cCountDirectories("D:\*.*") & vbCrLf & vbCrLf
  984.    strDisplay = strDisplay & "Number of directories in E:\ is " & cCountDirectories("E:\*.*") & vbCrLf & vbCrLf
  985.    txt_Result = strDisplay
  986.    'time the function
  987.    TimerHandle = cTimerOpen()
  988.    TimerStartOk = cTimerStart(TimerHandle)
  989.    For i = 1 To Iteration
  990.       lngResult = cCountDirectories("C:\*.*")
  991.    Next i
  992.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  993.    TimerCloseOk = cTimerClose(TimerHandle)
  994. End Sub
  995. Private Sub TestFilesSizeX()
  996.    Dim lngResult        As Long
  997.    Dim strResult        As String
  998.    Dim strDisplay       As String
  999.    Dim i                As Long
  1000.    Dim Size1            As Double
  1001.    Dim Size2            As Double
  1002.    strResult = ""
  1003.    strDisplay = ""
  1004.    strDisplay = strDisplay & "Size of files c:\*.* is " & cFilesSize("c:\*.*") & vbCrLf
  1005.    strDisplay = strDisplay & "Size of files c:\*.bat is " & cFilesSize("c:\*.bat") & vbCrLf
  1006.    strDisplay = strDisplay & "Size of files c:\*.sys is " & cFilesSize("c:\*.sys") & vbCrLf
  1007.    strDisplay = strDisplay & "Size of files c:\*.com is " & cFilesSize("c:\*.com") & vbCrLf
  1008.    strDisplay = strDisplay & vbCrLf
  1009.    strDisplay = strDisplay & "Size of files c:\*.* on disk is " & cFilesSizeOnDisk("c:\*.*") & vbCrLf
  1010.    strDisplay = strDisplay & "Size of files c:\*.bat on disk is " & cFilesSizeOnDisk("c:\*.bat") & vbCrLf
  1011.    strDisplay = strDisplay & "Size of files c:\*.sys on disk is " & cFilesSizeOnDisk("c:\*.sys") & vbCrLf
  1012.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cFilesSizeOnDisk("c:\*.com") & vbCrLf
  1013.    strDisplay = strDisplay & vbCrLf
  1014.    strDisplay = strDisplay & "Slack of files c:\*.* on disk is " & cFilesSlack("c:\*.*", Size1, Size2) & " %" & vbCrLf
  1015.    strDisplay = strDisplay & "Slack of files c:\*.bat on disk is " & cFilesSlack("c:\*.bat", Size1, Size2) & " %" & vbCrLf
  1016.    strDisplay = strDisplay & "Slack of files c:\*.sys on disk is " & cFilesSlack("c:\*.sys", Size1, Size2) & " %" & vbCrLf
  1017.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cFilesSlack("c:\*.com", Size1, Size2) & " %" & vbCrLf
  1018.    txt_Result = strDisplay
  1019.    'time the function
  1020.    TimerHandle = cTimerOpen()
  1021.    TimerStartOk = cTimerStart(TimerHandle)
  1022.    For i = 1 To Iteration
  1023.       lngResult = cFilesSize("c:\*.*")
  1024.    Next i
  1025.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1026.    TimerCloseOk = cTimerClose(TimerHandle)
  1027. End Sub
  1028. Private Sub TestRcsFilesSizeX()
  1029.    Dim lngResult        As Long
  1030.    Dim strResult        As String
  1031.    Dim strDisplay       As String
  1032.    Dim i                As Long
  1033.    Dim Size1            As Double
  1034.    Dim Size2            As Double
  1035.    strResult = ""
  1036.    strDisplay = ""
  1037.    strDisplay = strDisplay & "Size of files c:\*.* is " & cRcsFilesSize("c:\", "*.*", False) & vbCrLf
  1038.    strDisplay = strDisplay & "Size of files c:\*.exe is " & cRcsFilesSize("c:\", "*.exe", False) & vbCrLf
  1039.    strDisplay = strDisplay & "Size of files c:\*.com is " & cRcsFilesSize("c:\", "*.com", False) & vbCrLf
  1040.    strDisplay = strDisplay & vbCrLf
  1041.    strDisplay = strDisplay & "Size of files c:\*.* on disk is " & cRcsFilesSizeOnDisk("c:\", "*.*", False) & vbCrLf
  1042.    strDisplay = strDisplay & "Size of files c:\*.exe on disk is " & cRcsFilesSizeOnDisk("c:\", "*.exe", False) & vbCrLf
  1043.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cRcsFilesSizeOnDisk("c:\", "*.com", False) & vbCrLf
  1044.    strDisplay = strDisplay & vbCrLf
  1045.    strDisplay = strDisplay & "Slack of files c:\*.* on disk is " & cRcsFilesSlack("c:\", "*.*", False, Size1, Size2) & " %" & vbCrLf
  1046.    strDisplay = strDisplay & "Slack of files c:\*.exe on disk is " & cRcsFilesSlack("c:\", "*.exe", False, Size1, Size2) & " %" & vbCrLf
  1047.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cRcsFilesSlack("c:\", "*.com", False, Size1, Size2) & " %" & vbCrLf
  1048.    strDisplay = strDisplay & vbCrLf
  1049.    strDisplay = strDisplay & "Size of files c:\*.* is " & cRcsFilesSize("c:\", "*.*", True) & vbCrLf
  1050.    strDisplay = strDisplay & "Size of files c:\*.exe is " & cRcsFilesSize("c:\", "*.exe", True) & vbCrLf
  1051.    strDisplay = strDisplay & "Size of files c:\*.com is " & cRcsFilesSize("c:\", "*.com", True) & vbCrLf
  1052.    strDisplay = strDisplay & vbCrLf
  1053.    strDisplay = strDisplay & "Size of files c:\*.* on disk is " & cRcsFilesSizeOnDisk("c:\", "*.*", True) & vbCrLf
  1054.    strDisplay = strDisplay & "Size of files c:\*.exe on disk is " & cRcsFilesSizeOnDisk("c:\", "*.exe", True) & vbCrLf
  1055.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cRcsFilesSizeOnDisk("c:\", "*.com", True) & vbCrLf
  1056.    strDisplay = strDisplay & vbCrLf
  1057.    strDisplay = strDisplay & "Slack of files c:\*.* on disk is " & cRcsFilesSlack("c:\", "*.*", True, Size1, Size2) & " %" & vbCrLf
  1058.    strDisplay = strDisplay & "Slack of files c:\*.exe on disk is " & cRcsFilesSlack("c:\", "*.exe", True, Size1, Size2) & " %" & vbCrLf
  1059.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cRcsFilesSlack("c:\", "*.com", True, Size1, Size2) & " %" & vbCrLf
  1060.    txt_Result = strDisplay
  1061.    'time the function
  1062.    TimerHandle = cTimerOpen()
  1063.    TimerStartOk = cTimerStart(TimerHandle)
  1064.    For i = 1 To Iteration
  1065.       lngResult = cRcsFilesSize("c:\", "*.*", False)
  1066.    Next i
  1067.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1068.    TimerCloseOk = cTimerClose(TimerHandle)
  1069. End Sub
  1070. Private Sub TestTruncatePath()
  1071.    Dim intResult        As Integer
  1072.    Dim strResult        As String
  1073.    Dim strDisplay       As String
  1074.    Dim i                As Integer
  1075.    Dim File1            As String
  1076.    strResult = ""
  1077.    strDisplay = ""
  1078.    strDisplay = strDisplay & "Truncate the following path with a length of 25" & vbCrLf & vbCrLf
  1079.    File1 = "t2win-16.bas"
  1080.    strResult = cTruncatePath(File1, 25)
  1081.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1082.    File1 = "windows\system\t2win-16.bas"
  1083.    strResult = cTruncatePath(File1, 25)
  1084.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1085.    File1 = "c:\win95\system\t2win-16.bas"
  1086.    strResult = cTruncatePath(File1, 25)
  1087.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1088.    File1 = "c:\win95\system\visual\t2win-16\t2win-16.bas"
  1089.    strResult = cTruncatePath(File1, 25)
  1090.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1091.    File1 = "c:\win95\system\visual\source\t2win-16\t2win-16.bas"
  1092.    strResult = cTruncatePath(File1, 25)
  1093.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf & vbCrLf
  1094.    strDisplay = strDisplay & "Truncate the following path with a length of 35" & vbCrLf & vbCrLf
  1095.    File1 = "t2win-16.bas"
  1096.    strResult = cTruncatePath(File1, 35)
  1097.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1098.    File1 = "windows\system\t2win-16.bas"
  1099.    strResult = cTruncatePath(File1, 35)
  1100.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1101.    File1 = "c:\win95\system\t2win-16.bas"
  1102.    strResult = cTruncatePath(File1, 35)
  1103.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1104.    File1 = "c:\win95\system\visual\t2win-16\t2win-16.bas"
  1105.    strResult = cTruncatePath(File1, 35)
  1106.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1107.    File1 = "c:\win95\system\visual\source\t2win-16\t2win-16.bas"
  1108.    strResult = cTruncatePath(File1, 35)
  1109.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf & vbCrLf
  1110.      
  1111.    txt_Result = strDisplay
  1112.    'time the function
  1113.    TimerHandle = cTimerOpen()
  1114.    TimerStartOk = cTimerStart(TimerHandle)
  1115.    For i = 1 To Iteration
  1116.       strResult = cTruncatePath(File1, 35)
  1117.    Next i
  1118.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1119.    TimerCloseOk = cTimerClose(TimerHandle)
  1120. End Sub
  1121. Private Sub TestMakeSplitPath()
  1122.    Dim intResult        As Integer
  1123.    Dim strResult        As String
  1124.    Dim strDisplay       As String
  1125.    Dim i                As Integer
  1126.    Dim SPLITPATH        As tagSPLITPATH
  1127.    Dim File1            As String
  1128.    strResult = ""
  1129.    strDisplay = ""
  1130.    File1 = cMakePath("c", "\this is a test", "test", "dat")
  1131.    strDisplay = strDisplay & "Make Path of (c,\this is a test,test,dat) is '" & File1 & "'" & vbCrLf & vbCrLf
  1132.    strDisplay = strDisplay & "Split Path '" & File1 & "' into four components is :" & vbCrLf & vbCrLf
  1133.    intResult = cSplitPath(File1, SPLITPATH)
  1134.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nDrive & vbCrLf
  1135.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nDir & vbCrLf
  1136.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nName & vbCrLf
  1137.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nExt & vbCrLf & vbCrLf
  1138.    txt_Result = strDisplay
  1139.    'time the function
  1140.    TimerHandle = cTimerOpen()
  1141.    TimerStartOk = cTimerStart(TimerHandle)
  1142.    For i = 1 To Iteration
  1143.       strResult = cMakePath("c", "this is a test", "test", "dat")
  1144.    Next i
  1145.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1146.    TimerCloseOk = cTimerClose(TimerHandle)
  1147. End Sub
  1148. Private Sub TestFullPath()
  1149.    Dim intResult        As Integer
  1150.    Dim strResult        As String
  1151.    Dim strDisplay       As String
  1152.    Dim i                As Integer
  1153.    Dim File1            As String
  1154.    strResult = ""
  1155.    strDisplay = ""
  1156.    File1 = T2WFileTest
  1157.    strDisplay = strDisplay & "Full Path of " & File1 & " is " & cFullPath(File1) & vbCrLf & vbCrLf
  1158.    File1 = cGetSystemDirectory() & "\t2win-32.dll"
  1159.    strDisplay = strDisplay & "Full Path of " & File1 & " is " & cFullPath(File1) & vbCrLf & vbCrLf
  1160.    File1 = cFilesInDirectory(cGetDefaultCurrentDir() + "\*.*", True)
  1161.    strDisplay = strDisplay & "Full Path of " & File1 & " is " & cFullPath(File1) & vbCrLf & vbCrLf
  1162.    txt_Result = strDisplay
  1163.    'time the function
  1164.    TimerHandle = cTimerOpen()
  1165.    TimerStartOk = cTimerStart(TimerHandle)
  1166.    For i = 1 To Iteration
  1167.       strResult = cFullPath(File1)
  1168.    Next i
  1169.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1170.    TimerCloseOk = cTimerClose(TimerHandle)
  1171. End Sub
  1172. Private Sub TestRenameFile()
  1173.    Dim intResult        As Integer
  1174.    Dim strResult        As String
  1175.    Dim strDisplay       As String
  1176.    Dim i                As Integer
  1177.    Dim File1            As String
  1178.    Dim File2            As String
  1179.    strResult = ""
  1180.    strDisplay = ""
  1181.    File1 = "this.is.a.test.~~~"
  1182.    File2 = "an another test.---"
  1183.    intResult = cKillFile(File1)
  1184.    intResult = cKillFile(File2)
  1185.    Close #1
  1186.    Open File1 For Output Shared As #1
  1187.    Print #1, File1
  1188.    Print #1, File2
  1189.    Close #1
  1190.    strDisplay = "File '" & File1 & "' " & IIf(cRenameFile(File1, File2) = True, "renamed in '" & File2 & "'", "is not renamed") & vbCrLf & vbCrLf
  1191.    txt_Result = strDisplay
  1192.    'time the function
  1193.    TimerHandle = cTimerOpen()
  1194.    TimerStartOk = cTimerStart(TimerHandle)
  1195.    For i = 1 To Iteration
  1196.       intResult = cRenameFile(File1, File2)
  1197.    Next i
  1198.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1199.    TimerCloseOk = cTimerClose(TimerHandle)
  1200. End Sub
  1201. Public Sub TestUniqueFileName()
  1202.    Dim intResult        As Integer
  1203.    Dim strResult        As String
  1204.    Dim strDisplay       As String
  1205.    Dim i                As Integer
  1206.    Dim File1            As String
  1207.    strResult = ""
  1208.    strDisplay = ""
  1209.    File1 = "WN"
  1210.    strDisplay = strDisplay + "Generate unique filename with template '" & File1 & "' is '" & cUniqueFileName(File1) & "'" & vbCrLf & vbCrLf
  1211.    txt_Result = strDisplay
  1212.    'time the function
  1213.    TimerHandle = cTimerOpen()
  1214.    TimerStartOk = cTimerStart(TimerHandle)
  1215.    For i = 1 To Iteration
  1216.       strResult = cUniqueFileName(File1)
  1217.    Next i
  1218.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1219.    TimerCloseOk = cTimerClose(TimerHandle)
  1220. End Sub
  1221. Private Sub TestFilesInDirectory()
  1222.    Dim intResult        As Integer
  1223.    Dim strResult        As String
  1224.    Dim strDisplay       As String
  1225.    Dim i                As Integer
  1226.    Dim File1            As String
  1227.    strResult = ""
  1228.    strDisplay = ""
  1229.    File1 = "*.*"
  1230.    strDisplay = strDisplay + "The 10 first files in the current directory '" & cGetDriveCurrentDir("C") & "'" & vbCrLf & vbCrLf
  1231.    strResult = cFilesInDirectory(File1, True)
  1232.    For i = 1 To 10
  1233.       strDisplay = strDisplay & strResult & vbCrLf
  1234.       strResult = cFilesInDirectory(File1, False)
  1235.    Next i
  1236.    strDisplay = strDisplay + vbCrLf
  1237.    File1 = "C:\*.*"
  1238.    strDisplay = strDisplay + "The 10 first files in '" & File1 & "'" & vbCrLf & vbCrLf
  1239.    strResult = cFilesInDirectory(File1, True)
  1240.    For i = 1 To 10
  1241.       strDisplay = strDisplay & strResult & vbCrLf
  1242.       strResult = cFilesInDirectory(File1, False)
  1243.    Next i
  1244.    txt_Result = strDisplay
  1245.    'time the function
  1246.    TimerHandle = cTimerOpen()
  1247.    TimerStartOk = cTimerStart(TimerHandle)
  1248.    For i = 1 To Iteration
  1249.       strResult = cFilesInDirectory(File1, True)
  1250.    Next i
  1251.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1252.    TimerCloseOk = cTimerClose(TimerHandle)
  1253. End Sub
  1254. Private Sub TestSubDirectory()
  1255.    Dim intResult        As Integer
  1256.    Dim strResult        As String
  1257.    Dim strDisplay       As String
  1258.    Dim i                As Integer
  1259.    Dim File1            As String
  1260.    strResult = ""
  1261.    strDisplay = ""
  1262.    File1 = "*.*"
  1263.    strDisplay = strDisplay + "The 10 first directory in the current directory '" & cGetDriveCurrentDir("C") & "'" & vbCrLf & vbCrLf
  1264.    strResult = cSubDirectory(File1, True)
  1265.    For i = 1 To 10
  1266.       strDisplay = strDisplay & strResult & vbCrLf
  1267.       strResult = cSubDirectory(File1, False)
  1268.    Next i
  1269.    strDisplay = strDisplay + vbCrLf
  1270.    File1 = "C:\*.*"
  1271.    strDisplay = strDisplay + "The 10 first directory in '" & File1 & "'" & vbCrLf & vbCrLf
  1272.    strResult = cSubDirectory(File1, True)
  1273.    For i = 1 To 10
  1274.       strDisplay = strDisplay & strResult & vbCrLf
  1275.       strResult = cSubDirectory(File1, False)
  1276.    Next i
  1277.    txt_Result = strDisplay
  1278.    'time the function
  1279.    TimerHandle = cTimerOpen()
  1280.    TimerStartOk = cTimerStart(TimerHandle)
  1281.    For i = 1 To Iteration
  1282.       strResult = cSubDirectory(File1, True)
  1283.    Next i
  1284.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1285.    TimerCloseOk = cTimerClose(TimerHandle)
  1286. End Sub
  1287. Private Sub TestFileGetAttribute()
  1288.    Dim intResult        As Integer
  1289.    Dim strResult        As String
  1290.    Dim strDisplay       As String
  1291.    Dim i                As Integer
  1292.    Dim File1            As String
  1293.    Dim FileAttrib       As FileAttributeType
  1294.    strResult = ""
  1295.    strDisplay = ""
  1296.    File1 = cFilesInDirectory("*.*", True)
  1297.    intResult = cFileGetAttrib(File1, FileAttrib)
  1298.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1299.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1300.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1301.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1302.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1303.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1304.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1305.      
  1306.    File1 = cGetWindowsDirectory() & "\user.dat"
  1307.    intResult = cFileGetAttrib(File1, FileAttrib)
  1308.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1309.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1310.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1311.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1312.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1313.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1314.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1315.      
  1316.    File1 = cSubDirectory("c:\*.*", True)
  1317.    File1 = cSubDirectory("c:\*.*", False)
  1318.    File1 = cSubDirectory("c:\*.*", False)
  1319.    File1 = "c:\" & File1
  1320.    intResult = cFileGetAttrib(File1, FileAttrib)
  1321.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1322.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1323.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1324.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1325.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1326.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1327.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1328.      
  1329.    txt_Result = strDisplay
  1330.    'time the function
  1331.    TimerHandle = cTimerOpen()
  1332.    TimerStartOk = cTimerStart(TimerHandle)
  1333.    For i = 1 To Iteration
  1334.       intResult = cFileGetAttrib(File1, FileAttrib)
  1335.    Next i
  1336.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1337.    TimerCloseOk = cTimerClose(TimerHandle)
  1338. End Sub
  1339. Private Sub TestFileSetAttribute()
  1340.    Dim intResult        As Integer
  1341.    Dim strResult        As String
  1342.    Dim strDisplay       As String
  1343.    Dim i                As Integer
  1344.    Dim File1            As String
  1345.    Dim FileAttrib       As FileAttributeType
  1346.    strResult = ""
  1347.    strDisplay = ""
  1348.    File1 = cFilesInDirectory("*.*", True)
  1349.    intResult = cFileGetAttrib(File1, FileAttrib)
  1350.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1351.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1352.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1353.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1354.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1355.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1356.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1357.    FileAttrib.Archive = False
  1358.    FileAttrib.Hidden = True
  1359.    FileAttrib.ReadOnly = True
  1360.    FileAttrib.System = True
  1361.    intResult = cFileSetAttrib(File1, FileAttrib)
  1362.    strDisplay = strDisplay & "Setting attribute (not archive, hidden, readonly, system) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  1363.      
  1364.    intResult = cFileGetAttrib(File1, FileAttrib)
  1365.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1366.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1367.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1368.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1369.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1370.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1371.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1372.    txt_Result = strDisplay
  1373.    'time the function
  1374.    TimerHandle = cTimerOpen()
  1375.    TimerStartOk = cTimerStart(TimerHandle)
  1376.    For i = 1 To Iteration
  1377.       intResult = cFileSetAttrib(File1, FileAttrib)
  1378.    Next i
  1379.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1380.    TimerCloseOk = cTimerClose(TimerHandle)
  1381. End Sub
  1382. Private Sub TestFileSetAllAttributes()
  1383.    Dim intResult        As Integer
  1384.    Dim strResult        As String
  1385.    Dim strDisplay       As String
  1386.    Dim i                As Integer
  1387.    Dim File1            As String
  1388.    Dim FileAttrib       As FileAttributeType
  1389.    strResult = ""
  1390.    strDisplay = ""
  1391.    File1 = cFilesInDirectory("*.*", True)
  1392.    intResult = cFileGetAttrib(File1, FileAttrib)
  1393.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1394.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1395.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1396.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1397.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1398.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1399.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1400.    intResult = cFileSetAllAttrib(File1)
  1401.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  1402.      
  1403.    intResult = cFileGetAttrib(File1, FileAttrib)
  1404.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1405.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1406.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1407.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1408.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1409.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1410.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1411.    txt_Result = strDisplay
  1412.    'time the function
  1413.    TimerHandle = cTimerOpen()
  1414.    TimerStartOk = cTimerStart(TimerHandle)
  1415.    For i = 1 To Iteration
  1416.       intResult = cFileSetAllAttrib(File1)
  1417.    Next i
  1418.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1419.    TimerCloseOk = cTimerClose(TimerHandle)
  1420. End Sub
  1421. Public Sub TestFileResetAllAttributes()
  1422.    Dim intResult        As Integer
  1423.    Dim strResult        As String
  1424.    Dim strDisplay       As String
  1425.    Dim i                As Integer
  1426.    Dim File1            As String
  1427.    Dim FileAttrib       As FileAttributeType
  1428.    strResult = ""
  1429.    strDisplay = ""
  1430.    File1 = cFilesInDirectory("*.*", True)
  1431.    intResult = cFileGetAttrib(File1, FileAttrib)
  1432.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1433.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1434.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1435.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1436.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1437.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1438.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1439.    intResult = cFileResetAllAttrib(File1)
  1440.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  1441.      
  1442.    intResult = cFileGetAttrib(File1, FileAttrib)
  1443.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1444.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1445.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1446.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1447.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1448.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1449.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1450.    txt_Result = strDisplay
  1451.    'time the function
  1452.    TimerHandle = cTimerOpen()
  1453.    TimerStartOk = cTimerStart(TimerHandle)
  1454.    For i = 1 To Iteration
  1455.       intResult = cFileResetAllAttrib(File1)
  1456.    Next i
  1457.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1458.    TimerCloseOk = cTimerClose(TimerHandle)
  1459. End Sub
  1460. Public Sub TestFileCompareX()
  1461.    Dim intResult        As Integer
  1462.    Dim strResult        As String
  1463.    Dim strDisplay       As String
  1464.    Dim i                As Integer
  1465.    Dim File1            As String
  1466.    Dim File2            As String
  1467.    Dim FileAttrib       As FileAttributeType
  1468.    strResult = ""
  1469.    strDisplay = ""
  1470.    File1 = T2WFileTest
  1471.    File2 = "autoexec.compare"
  1472.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  1473.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  1474.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  1475.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  1476.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  1477.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  1478.      
  1479.    Close #1
  1480.    Open File2 For Append Shared As #1
  1481.    Print #1, File2
  1482.    Close #1
  1483.      
  1484.    strDisplay = strDisplay & "Appending " & (Len(File2) + 2) & " chars to '" & File2 & "'" & vbCrLf & vbCrLf
  1485.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  1486.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  1487.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  1488.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  1489.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  1490.      
  1491.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) is " & cFileResetAllAttrib(File2) & vbCrLf & vbCrLf
  1492.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  1493.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  1494.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  1495.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  1496.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  1497.      
  1498.    txt_Result = strDisplay
  1499.    'time the function
  1500.    TimerHandle = cTimerOpen()
  1501.    TimerStartOk = cTimerStart(TimerHandle)
  1502.    For i = 1 To Iteration
  1503.       intResult = cCmpFileSize(File1, File2)
  1504.    Next i
  1505.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1506.    TimerCloseOk = cTimerClose(TimerHandle)
  1507. End Sub
  1508. Private Sub TestFileDrive()
  1509.    Dim intResult        As Integer
  1510.    Dim strResult        As String
  1511.    Dim strDisplay       As String
  1512.    Dim i                As Integer
  1513.    Dim File1            As String
  1514.    strResult = ""
  1515.    strDisplay = ""
  1516.    File1 = T2WFileTest
  1517.    strDisplay = strDisplay & "File drive of '" & File1 & "' is " & cFileDrive(File1) & vbCrLf & vbCrLf
  1518.    File1 = cGetWindowsDirectory() + "\user.dat"
  1519.    strDisplay = strDisplay & "File drive of '" & File1 & "' is " & cFileDrive(File1) & vbCrLf & vbCrLf
  1520.    txt_Result = strDisplay
  1521.    'time the function
  1522.    TimerHandle = cTimerOpen()
  1523.    TimerStartOk = cTimerStart(TimerHandle)
  1524.    For i = 1 To Iteration
  1525.       strResult = cFileDrive(File1)
  1526.    Next i
  1527.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1528.    TimerCloseOk = cTimerClose(TimerHandle)
  1529. End Sub
  1530. Private Sub TestFilesInDirOnDisk()
  1531.    Dim lngResult        As Long
  1532.    Dim strResult        As String
  1533.    Dim strDisplay       As String
  1534.    Dim i                As Integer
  1535.    Dim File1            As String
  1536.    Dim File2            As String
  1537.    strResult = ""
  1538.    strDisplay = ""
  1539.    File1 = "filesindirondisk.temp"
  1540.    File2 = "c:\*.*"
  1541.    strDisplay = strDisplay & "Number of files '" & File2 & "' (with at least one of the following attribute)" & vbCrLf & vbCrLf
  1542.    strDisplay = strDisplay & "Any : " & cFilesInDirOnDisk(File1, File2, A_ALL) & vbCrLf
  1543.    strDisplay = strDisplay & "(N)ormal : " & cFilesInDirOnDisk(File1, File2, A_NORMAL) & vbCrLf
  1544.    strDisplay = strDisplay & "(A)rchive, (N)ormal : " & cFilesInDirOnDisk(File1, File2, A_NORMAL_ARCHIVE) & vbCrLf
  1545.    strDisplay = strDisplay & "(A)rchive : " & cFilesInDirOnDisk(File1, File2, A_ARCHIVE) & vbCrLf
  1546.    strDisplay = strDisplay & "(A)rchive, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_ARCHIVE Or A_RDONLY) & vbCrLf
  1547.    strDisplay = strDisplay & "(S)ystem, (H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_SYSTEM Or A_HIDDEN Or A_RDONLY) & vbCrLf
  1548.    strDisplay = strDisplay & "(H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_HIDDEN Or A_RDONLY) & vbCrLf
  1549.    strDisplay = strDisplay & "(R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_RDONLY) & vbCrLf
  1550.    strDisplay = strDisplay & vbCrLf
  1551.    strDisplay = strDisplay & "Number of files in '" & File2 & "' (with exact attribute excluding all others)" & vbCrLf & vbCrLf
  1552.    strDisplay = strDisplay & "(N)ormal : " & cFilesInDirOnDisk(File1, File2, -(A_NORMAL)) & vbCrLf
  1553.    strDisplay = strDisplay & "(A)rchive, (N)ormal : " & cFilesInDirOnDisk(File1, File2, -(A_NORMAL_ARCHIVE)) & vbCrLf
  1554.    strDisplay = strDisplay & "(A)rchive : " & cFilesInDirOnDisk(File1, File2, -(A_ARCHIVE)) & vbCrLf
  1555.    strDisplay = strDisplay & "(A)rchive, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_ARCHIVE Or A_RDONLY)) & vbCrLf
  1556.    strDisplay = strDisplay & "(S)ystem, (H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_SYSTEM Or A_HIDDEN Or A_RDONLY)) & vbCrLf
  1557.    strDisplay = strDisplay & "(A)rchive, (S)ystem, (H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_NORMAL Or A_SYSTEM Or A_HIDDEN Or A_RDONLY)) & vbCrLf
  1558.    strDisplay = strDisplay & "(H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_HIDDEN Or A_RDONLY)) & vbCrLf
  1559.    strDisplay = strDisplay & "(R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_RDONLY)) & vbCrLf
  1560.    strDisplay = strDisplay & vbCrLf
  1561.    txt_Result = strDisplay
  1562.    'time the function
  1563.    TimerHandle = cTimerOpen()
  1564.    TimerStartOk = cTimerStart(TimerHandle)
  1565.    For i = 1 To Iteration
  1566.       lngResult = cFilesInDirOnDisk(File1, File2, A_ALL)
  1567.    Next i
  1568.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1569.    TimerCloseOk = cTimerClose(TimerHandle)
  1570. End Sub
  1571. Private Sub TestFileDateTime()
  1572.    Dim intResult        As Integer
  1573.    Dim strResult        As String
  1574.    Dim strDisplay       As String
  1575.    Dim i                As Integer
  1576.    Dim File1            As String
  1577.    strResult = ""
  1578.    strDisplay = ""
  1579.    File1 = T2WFileTest
  1580.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  1581.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  1582.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  1583.    File1 = "c:\config.sys"
  1584.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  1585.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  1586.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  1587.    File1 = cGetSystemDirectory() + "\t2win-32.dll"
  1588.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  1589.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  1590.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  1591.    File1 = cGetWindowsDirectory() + "\user.dat"
  1592.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  1593.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  1594.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  1595.    txt_Result = strDisplay
  1596.    'time the function
  1597.    TimerHandle = cTimerOpen()
  1598.    TimerStartOk = cTimerStart(TimerHandle)
  1599.    For i = 1 To Iteration
  1600.       strResult = cFileDateCreated(File1)
  1601.    Next i
  1602.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1603.    TimerCloseOk = cTimerClose(TimerHandle)
  1604. End Sub
  1605. Private Sub TestFileStatistics()
  1606.    Dim lngResult        As Long
  1607.    Dim strResult        As String
  1608.    Dim strDisplay       As String
  1609.    Dim i                As Integer
  1610.    Dim nL               As Long
  1611.    Dim nW               As Long
  1612.    Dim nC               As Long
  1613.    Dim File1            As String
  1614.    strResult = ""
  1615.    strDisplay = ""
  1616.    File1 = T2WFileTest
  1617.    strDisplay = strDisplay & "File statictics for '" & File1 & "' is " & cFileStatistics(File1, nL, nW, nC) & vbCrLf
  1618.    strDisplay = strDisplay & "number of lines : " & nL & vbCrLf
  1619.    strDisplay = strDisplay & "number of words : " & nW & vbCrLf
  1620.    strDisplay = strDisplay & "number of chars : " & nC & vbCrLf & vbCrLf
  1621.    File1 = "c:\config.sys"
  1622.    strDisplay = strDisplay & "File statictics for '" & File1 & "' is " & cFileStatistics(File1, nL, nW, nC) & vbCrLf
  1623.    strDisplay = strDisplay & "number of lines : " & nL & vbCrLf
  1624.    strDisplay = strDisplay & "number of words : " & nW & vbCrLf
  1625.    strDisplay = strDisplay & "number of chars : " & nC & vbCrLf & vbCrLf
  1626.    txt_Result = strDisplay
  1627.    'time the function
  1628.    TimerHandle = cTimerOpen()
  1629.    TimerStartOk = cTimerStart(TimerHandle)
  1630.    For i = 1 To Iteration
  1631.       lngResult = cFileStatistics(File1, nL, nW, nC)
  1632.    Next i
  1633.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1634.    TimerCloseOk = cTimerClose(TimerHandle)
  1635. End Sub
  1636. Private Sub TestGetDriveType()
  1637.    Dim intResult        As Integer
  1638.    Dim strResult        As String
  1639.    Dim strDisplay       As String
  1640.    Dim i                As Integer
  1641.    strResult = ""
  1642.    strDisplay = ""
  1643.    For i = 1 To 26
  1644.       intResult = cGetDriveType(Chr$(64 + i))
  1645.       If (intResult > 0) Then
  1646.          strDisplay = strDisplay & "'" & Chr$(64 + i) & ":' is "
  1647.          Select Case intResult
  1648.             Case DRIVE_UNKNOWN
  1649.                strDisplay = strDisplay & "(unknown)" & vbCrLf
  1650.             Case DRIVE_NO_ROOT_DIR
  1651.                strDisplay = strDisplay & "(not root dir)" & vbCrLf
  1652.             Case DRIVE_REMOVABLE
  1653.                strDisplay = strDisplay & "removable" & vbCrLf
  1654.             Case DRIVE_FIXED
  1655.                strDisplay = strDisplay & "fixed disk" & vbCrLf
  1656.             Case DRIVE_REMOTE
  1657.                strDisplay = strDisplay & "remote disk" & vbCrLf
  1658.             Case DRIVE_CDROM
  1659.                strDisplay = strDisplay & "cd-rom" & vbCrLf
  1660.             Case DRIVE_RAMDISK
  1661.                strDisplay = strDisplay & "ram disk" & vbCrLf
  1662.          End Select
  1663.       End If
  1664.    Next i
  1665.      
  1666.    txt_Result = strDisplay
  1667.    'time the function
  1668.    TimerHandle = cTimerOpen()
  1669.    TimerStartOk = cTimerStart(TimerHandle)
  1670.    For i = 1 To Iteration
  1671.       intResult = cGetDriveType("C")
  1672.    Next i
  1673.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1674.    TimerCloseOk = cTimerClose(TimerHandle)
  1675. End Sub
  1676. Private Sub TestPBFileCopy()
  1677.    Dim intResult        As Long
  1678.    Dim strResult        As String
  1679.    Dim strDisplay       As String
  1680.    Dim i                As Long
  1681.    Dim File1            As String
  1682.    Dim File2            As String
  1683.    strResult = ""
  1684.    strDisplay = ""
  1685.    File1 = cGetWindowsDirectory() + "\" + "system.dat"
  1686.    File2 = "system.pbcopy"
  1687.    strDisplay = strDisplay & "PB File Copy '" & File1 & "' to '" & File2 & "' is " & cPBFileCopy(Me.hWnd, File1, File2) & vbCrLf & vbCrLf
  1688.    txt_Result = strDisplay
  1689.    'time the function
  1690.       
  1691.    DoEvents
  1692.    TimerHandle = cTimerOpen()
  1693.    TimerStartOk = cTimerStart(TimerHandle)
  1694.    For i = 1 To Iteration
  1695.       intResult = cPBFileCopy(Me.hWnd, File1, File2)
  1696.       DoEvents
  1697.    Next i
  1698.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1699.    TimerCloseOk = cTimerClose(TimerHandle)
  1700. End Sub
  1701. Private Sub TestDBFileCopy()
  1702.    Dim intResult        As Integer
  1703.    Dim strResult        As String
  1704.    Dim strDisplay       As String
  1705.    Dim i                As Long
  1706.    Dim File1            As String
  1707.    Dim File2            As String
  1708.    strResult = ""
  1709.    strDisplay = ""
  1710.    File1 = cGetWindowsDirectory() + "\" + "system.dat"
  1711.    File2 = "system.dbcopy"
  1712.    strDisplay = strDisplay & "DB File Copy '" & File1 & "' to '" & File2 & "' is " & cDBFileCopy("", "", "", "", File1, File2) & vbCrLf & vbCrLf
  1713.    File1 = cGetWindowsDirectory() + "\" + "command.com"
  1714.    File2 = "command.dbcopy"
  1715.    strDisplay = strDisplay & "DB File Copy '" & File1 & "' to '" & File2 & "' is " & cDBFileCopy("", "", "", "", File1, File2) & vbCrLf & vbCrLf
  1716.    txt_Result = strDisplay
  1717.    'time the function
  1718.    DoEvents
  1719.    TimerHandle = cTimerOpen()
  1720.    TimerStartOk = cTimerStart(TimerHandle)
  1721.    For i = 1 To Iteration
  1722.       intResult = cDBFileCopy("", "", "", "", File1, File2)
  1723.       DoEvents
  1724.    Next i
  1725.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1726.    TimerCloseOk = cTimerClose(TimerHandle)
  1727. End Sub
  1728. Private Sub TestFileUUCP()
  1729.    Dim lngResult        As Long
  1730.    Dim strResult        As String
  1731.    Dim strDisplay       As String
  1732.    Dim i                As Integer
  1733.    Dim File1            As String
  1734.    Dim File2            As String
  1735.    Dim File3            As String
  1736.    strResult = ""
  1737.    strDisplay = ""
  1738.    File1 = "c:\win95\system.dat"
  1739.    File2 = "system.uuencoded"
  1740.    File3 = "system.uudecoded"
  1741.    strDisplay = strDisplay & "File UUencode '" & File1 & "' to '" & File2 & "' is " & cFileUUCP(File1, File2, MODE_UUENCODE) & vbCrLf
  1742.    strDisplay = strDisplay & "File UUdecode '" & File2 & "' to '" & File3 & "' is " & cFileUUCP(File2, File3, MODE_UUDECODE) & vbCrLf
  1743.    strDisplay = strDisplay & "Compare File contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  1744.    File1 = T2WFileTest
  1745.    File2 = "autoexec.uuencoded"
  1746.    File3 = "autoexec.uudecoded"
  1747.    strDisplay = strDisplay & "File UUencode '" & File1 & "' to '" & File2 & "' is " & cFileUUCP(File1, File2, MODE_UUENCODE) & vbCrLf
  1748.    strDisplay = strDisplay & "File UUdecode '" & File2 & "' to '" & File3 & "' is " & cFileUUCP(File2, File3, MODE_UUDECODE) & vbCrLf
  1749.    strDisplay = strDisplay & "Compare File contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  1750.    txt_Result = strDisplay
  1751.    'time the function
  1752.    TimerHandle = cTimerOpen()
  1753.    TimerStartOk = cTimerStart(TimerHandle)
  1754.    For i = 1 To Iteration
  1755.       lngResult = cFileUUCP(File1, File2, MODE_UUENCODE)
  1756.    Next i
  1757.    lngResult = cFileUUCP(File2, File3, MODE_UUDECODE)
  1758.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1759.    TimerCloseOk = cTimerClose(TimerHandle)
  1760. End Sub
  1761. Private Sub TestOpenFiles(Mode As Integer)
  1762.    Dim intResult        As Integer
  1763.    Dim OpenFileName     As String
  1764.    Dim OpenFileMode     As Long
  1765.    Dim OpenFileType     As Long
  1766.    Dim strDisplay       As String
  1767.    Dim i                As Long
  1768.    strDisplay = ""
  1769.    i = -1
  1770.    TimerHandle = cTimerOpen()
  1771.    TimerStartOk = cTimerStart(TimerHandle)
  1772.    intResult = cEnumOpenFiles("C", Mode, True, OpenFileName, OpenFileMode, OpenFileType)
  1773.    strDisplay = "All open files on drive C are " & vbCrLf & vbCrLf
  1774.    While (intResult = NO_ERROR_OPEN_FILES)
  1775.       strDisplay = strDisplay + OpenFileName + " , " & OpenFileMode & " , " & OpenFileType & vbCrLf
  1776.       intResult = cEnumOpenFiles("C", Mode, False, OpenFileName, OpenFileMode, OpenFileType)
  1777.    Wend
  1778.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1779.    TimerCloseOk = cTimerClose(TimerHandle)
  1780.    txt_Result = strDisplay
  1781. End Sub
  1782. Private Sub TestSplitFile()
  1783.    Dim lngResult        As Long
  1784.    Dim strResult        As String
  1785.    Dim strDisplay       As String
  1786.    Dim i                As Long
  1787.    Dim n                As Long
  1788.    Dim File1            As String
  1789.    Dim File2            As String
  1790.    strResult = ""
  1791.    strDisplay = ""
  1792.    File1 = cGetSystemDirectory + "\VBA2.DLL"
  1793.    File2 = "vba2test"
  1794.    strDisplay = strDisplay & "FileSize of '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  1795.    n = cSplitFile(File1, File2, cFileSize(File1) \ 7) - 1
  1796.    strDisplay = strDisplay & "SplitFile '" & File1 & "' into part size of '" & (cFileSize(File1) \ 7) & "' bytes return '" & (n + 1) & "' file(s)" & vbCrLf & vbCrLf
  1797.    For i = 0 To n
  1798.       strResult = File2 & "." & Format$(i, "000")
  1799.       strDisplay = strDisplay & "FileSize of '" & strResult & "' is " & cFileSize(strResult) & vbCrLf
  1800.    Next i
  1801.    strDisplay = strDisplay & vbCrLf
  1802.    File1 = T2WFileTest
  1803.    File2 = "autoexec"
  1804.    strDisplay = strDisplay & "FileSize of '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  1805.    n = cSplitFile(File1, File2, 257) - 1
  1806.    strDisplay = strDisplay & "SplitFile '" & File1 & "' into part size of 257 bytes return '" & (n + 1) & "' file(s)" & vbCrLf & vbCrLf
  1807.    For i = 0 To n
  1808.       strResult = File2 & "." & Format$(i, "000")
  1809.       strDisplay = strDisplay & "FileSize of '" & strResult & "' is " & cFileSize(strResult) & vbCrLf
  1810.    Next i
  1811.    strDisplay = strDisplay & vbCrLf
  1812.    n = cSplitFile(File1, File2, 1025) - 1
  1813.    strDisplay = strDisplay & "SplitFile '" & File1 & "' into part size of 1025 bytes return '" & (n + 1) & "' file(s)" & vbCrLf & vbCrLf
  1814.    For i = 0 To n
  1815.       strResult = File2 & "." & Format$(i, "000")
  1816.       strDisplay = strDisplay & "FileSize of '" & strResult & "' is " & cFileSize(strResult) & vbCrLf
  1817.    Next i
  1818.    txt_Result = strDisplay
  1819.    'time the function
  1820.    TimerHandle = cTimerOpen()
  1821.    TimerStartOk = cTimerStart(TimerHandle)
  1822.    For i = 1 To Iteration
  1823.       lngResult = cSplitFile(File1, File2, 257)
  1824.    Next i
  1825.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1826.    TimerCloseOk = cTimerClose(TimerHandle)
  1827. End Sub
  1828. Private Sub TestCutFile()
  1829.    Dim lngResult        As Long
  1830.    Dim strResult        As String
  1831.    Dim strDisplay       As String
  1832.    Dim i                As Long
  1833.    Dim n                As Long
  1834.    Dim File1            As String
  1835.    Dim File2            As String
  1836.    Dim File3            As String
  1837.    strResult = ""
  1838.    strDisplay = ""
  1839.    File1 = cGetSystemDirectory + "\VBA2.DLL"
  1840.    File2 = "vba2test.cut1"
  1841.    File3 = "vba2test.cut2"
  1842.    n = cFileSize(File1) * 1 / 4
  1843.    strDisplay = strDisplay & "CutFile '" & File1 & "' at position '" & n & "' to '" & File2 & "' and '" & File3 & "' is " & cCutFile(File1, File2, File3, n) & vbCrLf & vbCrLf
  1844.    strDisplay = strDisplay & "FileSize of '" & File1 & "' is " & cFileSize(File1) & vbCrLf
  1845.    strDisplay = strDisplay & "FileSize of '" & File2 & "' is " & cFileSize(File2) & vbCrLf
  1846.    strDisplay = strDisplay & "FileSize of '" & File3 & "' is " & cFileSize(File3) & vbCrLf
  1847.    strDisplay = strDisplay & vbCrLf
  1848.    File1 = T2WFileTest
  1849.    File2 = "autoexec.cut1"
  1850.    File3 = "autoexec.cut2"
  1851.    n = cFileSize(File1) * 1 \ 4
  1852.    strDisplay = strDisplay & "CutFile '" & File1 & "' at position '" & n & "' to '" & File2 & "' and '" & File3 & "' is " & cCutFile(File1, File2, File3, n) & vbCrLf & vbCrLf
  1853.    strDisplay = strDisplay & "FileSize of '" & File1 & "' is " & cFileSize(File1) & vbCrLf
  1854.    strDisplay = strDisplay & "FileSize of '" & File2 & "' is " & cFileSize(File2) & vbCrLf
  1855.    strDisplay = strDisplay & "FileSize of '" & File3 & "' is " & cFileSize(File3) & vbCrLf
  1856.    strDisplay = strDisplay & vbCrLf
  1857.    n = cFileSize(File1) * 3 \ 4
  1858.    strDisplay = strDisplay & "CutFile '" & File1 & "' at position '" & n & "' to '" & File2 & "' and '" & File3 & "' is " & cCutFile(File1, File2, File3, n) & vbCrLf & vbCrLf
  1859.    strDisplay = strDisplay & "FileSize of '" & File1 & "' is " & cFileSize(File1) & vbCrLf
  1860.    strDisplay = strDisplay & "FileSize of '" & File2 & "' is " & cFileSize(File2) & vbCrLf
  1861.    strDisplay = strDisplay & "FileSize of '" & File3 & "' is " & cFileSize(File3) & vbCrLf
  1862.    txt_Result = strDisplay
  1863.    'time the function
  1864.    TimerHandle = cTimerOpen()
  1865.    TimerStartOk = cTimerStart(TimerHandle)
  1866.    For i = 1 To Iteration
  1867.       lngResult = cCutFile(File1, File2, File3, n)
  1868.    Next i
  1869.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1870.    TimerCloseOk = cTimerClose(TimerHandle)
  1871. End Sub
  1872. Private Sub TestGetFileDateTime()
  1873.    Dim intResult        As Integer
  1874.    Dim strDisplay       As String
  1875.    Dim SysCreation      As tagSYSTEMTIME
  1876.    Dim SysLastAccess    As tagSYSTEMTIME
  1877.    Dim SysLastWrite     As tagSYSTEMTIME
  1878.    Dim i                As Integer
  1879.    Dim File1            As String
  1880.    strDisplay = ""
  1881.    File1 = T2WFileTest
  1882.    strDisplay = strDisplay & "File '" & File1 & "'" & vbCrLf
  1883.    intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  1884.    If (intResult <> True) Then
  1885.       strDisplay = strDisplay & "   Can't get date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  1886.    Else
  1887.       strDisplay = strDisplay & "   Creation : " & Format$(DateSerial(SysCreation.wYear, SysCreation.wMonth, SysCreation.wDay), "short date") & " " & Format$(TimeSerial(SysCreation.wHour, SysCreation.wMinute, SysCreation.wSecond), "hh:mm:ss") & vbCrLf
  1888.       strDisplay = strDisplay & "   Last Access : " & Format$(DateSerial(SysLastAccess.wYear, SysLastAccess.wMonth, SysLastAccess.wDay), "short date") & " " & Format$(TimeSerial(SysLastAccess.wHour, SysLastAccess.wMinute, SysLastAccess.wSecond), "hh:mm:ss") & vbCrLf
  1889.       strDisplay = strDisplay & "   Last Write : " & Format$(DateSerial(SysLastWrite.wYear, SysLastWrite.wMonth, SysLastWrite.wDay), "short date") & " " & Format$(TimeSerial(SysLastWrite.wHour, SysLastWrite.wMinute, SysLastWrite.wSecond), "hh:mm:ss") & vbCrLf & vbCrLf
  1890.    End If
  1891.    File1 = "c:\config.sys"
  1892.    strDisplay = strDisplay & "File '" & File1 & "'" & vbCrLf
  1893.    intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  1894.    If (intResult <> True) Then
  1895.       strDisplay = strDisplay & "   Can't get date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  1896.    Else
  1897.       strDisplay = strDisplay & "   Creation : " & Format$(DateSerial(SysCreation.wYear, SysCreation.wMonth, SysCreation.wDay), "short date") & " " & Format$(TimeSerial(SysCreation.wHour, SysCreation.wMinute, SysCreation.wSecond), "hh:mm:ss") & vbCrLf
  1898.       strDisplay = strDisplay & "   Last Access : " & Format$(DateSerial(SysLastAccess.wYear, SysLastAccess.wMonth, SysLastAccess.wDay), "short date") & " " & Format$(TimeSerial(SysLastAccess.wHour, SysLastAccess.wMinute, SysLastAccess.wSecond), "hh:mm:ss") & vbCrLf
  1899.       strDisplay = strDisplay & "   Last Write : " & Format$(DateSerial(SysLastWrite.wYear, SysLastWrite.wMonth, SysLastWrite.wDay), "short date") & " " & Format$(TimeSerial(SysLastWrite.wHour, SysLastWrite.wMinute, SysLastWrite.wSecond), "hh:mm:ss") & vbCrLf & vbCrLf
  1900.    End If
  1901.    File1 = cGetSystemDirectory() + "\t2win-32.dll"
  1902.    strDisplay = strDisplay & "File '" & File1 & "'" & vbCrLf
  1903.    intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  1904.    If (intResult <> True) Then
  1905.       strDisplay = strDisplay & "   Can't get date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  1906.    Else
  1907.       strDisplay = strDisplay & "   Creation : " & Format$(DateSerial(SysCreation.wYear, SysCreation.wMonth, SysCreation.wDay), "short date") & " " & Format$(TimeSerial(SysCreation.wHour, SysCreation.wMinute, SysCreation.wSecond), "hh:mm:ss") & vbCrLf
  1908.       strDisplay = strDisplay & "   Last Access : " & Format$(DateSerial(SysLastAccess.wYear, SysLastAccess.wMonth, SysLastAccess.wDay), "short date") & " " & Format$(TimeSerial(SysLastAccess.wHour, SysLastAccess.wMinute, SysLastAccess.wSecond), "hh:mm:ss") & vbCrLf
  1909.       strDisplay = strDisplay & "   Last Write : " & Format$(DateSerial(SysLastWrite.wYear, SysLastWrite.wMonth, SysLastWrite.wDay), "short date") & " " & Format$(TimeSerial(SysLastWrite.wHour, SysLastWrite.wMinute, SysLastWrite.wSecond), "hh:mm:ss") & vbCrLf & vbCrLf
  1910.    End If
  1911.    File1 = cGetWindowsDirectory() + "\user.dat"
  1912.    strDisplay = strDisplay & "File '" & File1 & "'" & vbCrLf
  1913.    intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  1914.    If (intResult <> True) Then
  1915.       strDisplay = strDisplay & "   Can't get date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  1916.    Else
  1917.       strDisplay = strDisplay & "   Creation : " & Format$(DateSerial(SysCreation.wYear, SysCreation.wMonth, SysCreation.wDay), "short date") & " " & Format$(TimeSerial(SysCreation.wHour, SysCreation.wMinute, SysCreation.wSecond), "hh:mm:ss") & vbCrLf
  1918.       strDisplay = strDisplay & "   Last Access : " & Format$(DateSerial(SysLastAccess.wYear, SysLastAccess.wMonth, SysLastAccess.wDay), "short date") & " " & Format$(TimeSerial(SysLastAccess.wHour, SysLastAccess.wMinute, SysLastAccess.wSecond), "hh:mm:ss") & vbCrLf
  1919.       strDisplay = strDisplay & "   Last Write : " & Format$(DateSerial(SysLastWrite.wYear, SysLastWrite.wMonth, SysLastWrite.wDay), "short date") & " " & Format$(TimeSerial(SysLastWrite.wHour, SysLastWrite.wMinute, SysLastWrite.wSecond), "hh:mm:ss") & vbCrLf & vbCrLf
  1920.    End If
  1921.    txt_Result = strDisplay
  1922.    'time the function
  1923.    TimerHandle = cTimerOpen()
  1924.    TimerStartOk = cTimerStart(TimerHandle)
  1925.    For i = 1 To Iteration
  1926.       intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  1927.    Next i
  1928.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1929.    TimerCloseOk = cTimerClose(TimerHandle)
  1930. End Sub
  1931. Private Sub TestSetFileDateTime()
  1932.    Dim intResult        As Integer
  1933.    Dim strDisplay       As String
  1934.    Dim SysCreation      As tagSYSTEMTIME
  1935.    Dim SysLastAccess    As tagSYSTEMTIME
  1936.    Dim SysLastWrite     As tagSYSTEMTIME
  1937.    Dim BckSysCreation   As tagSYSTEMTIME
  1938.    Dim BckSysLastAccess As tagSYSTEMTIME
  1939.    Dim BckSysLastWrite  As tagSYSTEMTIME
  1940.    Dim i                As Integer
  1941.    Dim File1            As String
  1942.    strDisplay = ""
  1943.    File1 = T2WFileTest
  1944.    strDisplay = strDisplay & "Get date & time information for file '" & File1 & "'" & vbCrLf
  1945.    intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  1946.    If (intResult <> True) Then
  1947.       strDisplay = strDisplay & "   Can't get date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  1948.    Else
  1949.       strDisplay = strDisplay & "   Creation : " & Format$(DateSerial(SysCreation.wYear, SysCreation.wMonth, SysCreation.wDay), "short date") & " " & Format$(TimeSerial(SysCreation.wHour, SysCreation.wMinute, SysCreation.wSecond), "hh:mm:ss") & vbCrLf
  1950.       strDisplay = strDisplay & "   Last Access : " & Format$(DateSerial(SysLastAccess.wYear, SysLastAccess.wMonth, SysLastAccess.wDay), "short date") & " " & Format$(TimeSerial(SysLastAccess.wHour, SysLastAccess.wMinute, SysLastAccess.wSecond), "hh:mm:ss") & vbCrLf
  1951.       strDisplay = strDisplay & "   Last Write : " & Format$(DateSerial(SysLastWrite.wYear, SysLastWrite.wMonth, SysLastWrite.wDay), "short date") & " " & Format$(TimeSerial(SysLastWrite.wHour, SysLastWrite.wMinute, SysLastWrite.wSecond), "hh:mm:ss") & vbCrLf & vbCrLf
  1952.    End If
  1953.    Call cTypesCopy(SysCreation, BckSysCreation, Len(SysCreation))
  1954.    Call cTypesCopy(SysLastAccess, BckSysLastAccess, Len(SysLastAccess))
  1955.    Call cTypesCopy(SysLastWrite, BckSysLastWrite, Len(SysLastWrite))
  1956.    strDisplay = strDisplay & "Set actual date & time information for file '" & File1 & "'" & vbCrLf & vbCrLf
  1957.    SysCreation.wYear = Year(Now())
  1958.    SysCreation.wMonth = Month(Now())
  1959.    SysCreation.wDay = Day(Now())
  1960.    SysCreation.wHour = Hour(Now())
  1961.    SysCreation.wMinute = Minute(Now())
  1962.    SysCreation.wSecond = Second(Now())
  1963.    Call cTypesCopy(SysCreation, SysLastAccess, Len(SysCreation))
  1964.    Call cTypesCopy(SysCreation, SysLastWrite, Len(SysCreation))
  1965.    intResult = cSetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  1966.    If (intResult <> True) Then
  1967.       strDisplay = strDisplay & "   Can't set date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  1968.    Else
  1969.       strDisplay = strDisplay & "   Get actual date & time information for file '" & File1 & "'" & vbCrLf
  1970.       intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  1971.       If (intResult <> True) Then
  1972.          strDisplay = strDisplay & "      Can't get date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  1973.       Else
  1974.          strDisplay = strDisplay & "      Creation : " & Format$(DateSerial(SysCreation.wYear, SysCreation.wMonth, SysCreation.wDay), "short date") & " " & Format$(TimeSerial(SysCreation.wHour, SysCreation.wMinute, SysCreation.wSecond), "hh:mm:ss") & vbCrLf
  1975.          strDisplay = strDisplay & "      Last Access : " & Format$(DateSerial(SysLastAccess.wYear, SysLastAccess.wMonth, SysLastAccess.wDay), "short date") & " " & Format$(TimeSerial(SysLastAccess.wHour, SysLastAccess.wMinute, SysLastAccess.wSecond), "hh:mm:ss") & vbCrLf
  1976.          strDisplay = strDisplay & "      Last Write : " & Format$(DateSerial(SysLastWrite.wYear, SysLastWrite.wMonth, SysLastWrite.wDay), "short date") & " " & Format$(TimeSerial(SysLastWrite.wHour, SysLastWrite.wMinute, SysLastWrite.wSecond), "hh:mm:ss") & vbCrLf & vbCrLf
  1977.       End If
  1978.    End If
  1979.    strDisplay = strDisplay & "Restore date & time information for file '" & File1 & "'" & vbCrLf & vbCrLf
  1980.    intResult = cSetFileDateTime(File1, BckSysCreation, BckSysLastAccess, BckSysLastWrite)
  1981.    If (intResult <> True) Then
  1982.       strDisplay = strDisplay & "   Can't restore date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  1983.    Else
  1984.       strDisplay = strDisplay & "   Get actual date & time information for file '" & File1 & "'" & vbCrLf
  1985.       intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  1986.       If (intResult <> True) Then
  1987.          strDisplay = strDisplay & "      Can't get date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  1988.       Else
  1989.          strDisplay = strDisplay & "      Creation : " & Format$(DateSerial(SysCreation.wYear, SysCreation.wMonth, SysCreation.wDay), "short date") & " " & Format$(TimeSerial(SysCreation.wHour, SysCreation.wMinute, SysCreation.wSecond), "hh:mm:ss") & vbCrLf
  1990.          strDisplay = strDisplay & "      Last Access : " & Format$(DateSerial(SysLastAccess.wYear, SysLastAccess.wMonth, SysLastAccess.wDay), "short date") & " " & Format$(TimeSerial(SysLastAccess.wHour, SysLastAccess.wMinute, SysLastAccess.wSecond), "hh:mm:ss") & vbCrLf
  1991.          strDisplay = strDisplay & "      Last Write : " & Format$(DateSerial(SysLastWrite.wYear, SysLastWrite.wMonth, SysLastWrite.wDay), "short date") & " " & Format$(TimeSerial(SysLastWrite.wHour, SysLastWrite.wMinute, SysLastWrite.wSecond), "hh:mm:ss") & vbCrLf & vbCrLf
  1992.       End If
  1993.    End If
  1994.    txt_Result = strDisplay
  1995.    'time the function
  1996.    TimerHandle = cTimerOpen()
  1997.    TimerStartOk = cTimerStart(TimerHandle)
  1998.    For i = 1 To Iteration
  1999.       intResult = cSetFileDateTime(File1, BckSysCreation, BckSysLastAccess, BckSysLastWrite)
  2000.    Next i
  2001.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2002.    TimerCloseOk = cTimerClose(TimerHandle)
  2003. End Sub
  2004.